﻿@using TP_02.Models
@model TP_02.Models.Game

@{
    ViewBag.Title = "Details";
}

<h2>Details</h2>

<hr/>

<div>
    <dl class="dl-horizontal">
        <dt>
            @Html.DisplayNameFor(model => model.Name)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.Name)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.GameRating)
        </dt>

        <dd>
            @{
               var gameRating = Model.GameRating;
            }
            @gameRating
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.CategoryId)
        </dt>

        <dd>
            @{
                var gc = GameCategory.FindOne(Model.CategoryId);
            }
            @if (gc == null)
            {
                <p>No Category </p>
            }
            else
            {
                @gc.Name
            }
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.Developer)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.Developer)
        </dd>

    </dl>
</div>
<p>
    @Html.ActionLink("Edit", "Edit", new { id = Model.Id }) |
    @Html.ActionLink("Back to List", "Index")
</p>
